package com.zqj.project.common.exception;

import com.zqj.project.common.exception.code.ExceptionCode;

import java.io.Serial;

/**
 * @Description: ArgumentException
 * @Author: 22001010704 Zhang Qijian
 * @CreateTime: 2024/6/12 23:44
 * @Version: 1.0
 */
public class ArgumentException extends BaseUncheckedException {

    @Serial
    private static final long serialVersionUID = -3843907364558373817L;

    public ArgumentException(Throwable cause) {
        super(cause);
    }

    public ArgumentException(String message) {
        super(ExceptionCode.BASE_VALID_PARAM.getCode(), message);
    }

    public ArgumentException(String message, Throwable cause) {
        super(ExceptionCode.BASE_VALID_PARAM.getCode(), message, cause);
    }

    public ArgumentException(String format, Object... args) {
        super(ExceptionCode.BASE_VALID_PARAM.getCode(), format, args);
    }

    @Override
    public String toString() {
        return "ArgumentException [message=" + this.getMessage() + ", code=" + this.getCode() + "]";
    }

}